package com.avic.modules.equipment.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * @author zhangzikang 设备维护记录表
 * @date 2022-08-14
 */
@Data
@TableName("equipment_maintain")
@NoArgsConstructor
public class EquipmentMaintain implements Serializable {

    // id
    private String id;

    // 工单
    @NotBlank(message = "请填写维护工单")
    private String workOrder;

    // 等级
    private String grade;

    // 频次
    private String frequency;

    // 内容
    private String content;

    // 维护时间
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp maintainTime;

    // 设备拍照时间
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp photographTime;

    // 设备拍照
    private String photograph;

    // 设备编号
    @NotBlank(message = "请填写维护设备")
    private String equipNumber;

    // 设备名称
    private String equipName;

    // 维护人id
    private Long maintainerUserId;

    // 维护人名称
    private String maintainerName;

    // 联系方式
    private String pattern;

    // 创建时间
    private Timestamp createUserTime;

    // 备注
    private String remark;

    public void copy(EquipmentMaintain source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
